package core.hmxchen.test.two;

import core.hmxchen.log.annotation.LogPrint;
import core.hmxchen.log.enums.Level;
import core.hmxchen.log.enums.Print;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @version v1.0.0
 * @ClassName LoginController
 * @Description TODO
 * @Author hmxchen
 * @Date 2021/9/5 21:46
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;
    @LogPrint(biz = "账号登录",level = Level.INFO,print = Print.AROUND_LOG)
    @GetMapping
    public Map login(String userName,String password){
        String uuid = loginService.loginUUID(userName, password);
        Map<String, Object> result = new HashMap<>(3);
        result.put("code", 200);
        result.put("msg", "success");
        result.put("data",uuid);
        return result;
    }


}
